#include "StdAfx.h"
#include "GameClock.h"

GameClock::GameClock(void)
{
	m_clock_count = 0;
}

GameClock::~GameClock(void)
{
}

DWORD GameClock::getClock(void)
{
	// this function returns the current tick count

	// return time
	return(GetTickCount());

} // end getClock

///////////////////////////////////////////////////////////

DWORD GameClock::startClock(void)
{
	// this function starts the clock, that is, saves the current
	// count, use in conjunction with Wait_Clock()

	return(m_clock_count = getClock());

} // end Start_Clock

DWORD GameClock::waitClock(DWORD count)
{
	// this function is used to wait for a specific number of clicks
	// since the call to Start_Clock

	while((getClock() - m_clock_count) < count);
		return(getClock());

} // end Wait_Clock